package com.eastfair.pay.service;

import com.eastfair.common.dto.JYApplyInvoiceInfoDTO;
import com.eastfair.common.dto.JYApplyRefundDTO;
import com.eastfair.common.dto.JYPaymentCollectRecordDTO;
import com.eastfair.common.dto.JYTransactionOrderDTO;
import com.eastfair.common.req.JYReq;
import com.eastfair.pay.dto.JYCancelInvoiceDTO;
import com.eastfair.pay.dto.JYPaymentDTO;
import com.eastfair.pay.dto.PaymentDTO;
import com.eastfair.pay.entity.ApplyRefund;
import com.eastfair.pay.entity.CollectRecord;
import com.eastfair.pay.entity.InvoiceApplyer;
import com.eastfair.pay.entity.PaymentRecord;
import com.eastfair.pay.entity.TransactionOrder;

import java.math.BigDecimal;

/**
 * <p>
 * 荆艺接口
 * </p>
 *
 * @author Du Xiaobo
 * @date 2023/4/21 10:48
 */
public interface JyService {


    /**
     * 构建同步新增订单到荆艺对象
     *
     * @param transactionOrder
     * @return
     */
    JYReq<JYTransactionOrderDTO> buildAddTransactionOrderToJy(TransactionOrder transactionOrder);


    /**
     * 构建同步新增订单到荆艺对象
     *
     * @param transactionOrder
     * @return
     */
    JYReq<JYTransactionOrderDTO> buildUpdateTransactionOrderToJy(TransactionOrder transactionOrder);


    /**
     * 构建同步新增订单到荆艺对象
     *
     * @param transactionOrder
     * @return
     */
    JYReq<JYTransactionOrderDTO> buildCancelTransactionOrderToJy(TransactionOrder transactionOrder);

    /**
     * 构建荆艺申请开票对象
     *
     * @param invoiceApplyer
     * @return
     */
    JYReq<JYApplyInvoiceInfoDTO> buildApplyInvoiceToJy(InvoiceApplyer invoiceApplyer);

    /**
     * 构建荆艺取消开票对象
     *
     * @param invoiceApplyer
     * @return
     */
    JYReq<JYCancelInvoiceDTO> buildCancelInvoiceToJy(InvoiceApplyer invoiceApplyer);

    /**
     * 构建荆艺退款对象
     *
     * @param applyRefund
     * @param transactionOrder
     * @return
     */
    JYReq<JYApplyRefundDTO> buildRefundToJy(ApplyRefund applyRefund, TransactionOrder transactionOrder);

    /**
     * 构建荆艺认款对象
     *
     * @param paymentRecord
     * @param transactionOrder
     * @param collectAmount
     * @return
     */
    JYReq<JYPaymentCollectRecordDTO> buildCollectToJy(PaymentRecord paymentRecord, TransactionOrder transactionOrder, BigDecimal collectAmount);

    /**
     * 构建荆艺取消认款对象
     *
     * @param paymentRecord
     * @param collectRecord
     * @return
     */
    JYReq<JYPaymentCollectRecordDTO> buildCancelCollectToJy(PaymentRecord paymentRecord, CollectRecord collectRecord);


    /**
     * 构建荆艺付款成功对象
     *
     * @param transactionOrder
     * @param payment
     * @return
     */
    JYReq<JYPaymentDTO> buildSuccessPaymentToJy(TransactionOrder transactionOrder, PaymentDTO payment);
}
